/**
 * 游历页面相关API
 */
import { post } from './request'

// 获取游历页面信息
export function getAdventureInfo() {
  return post('/adventure/info', {
  })
}

// 获取主线任务列表
export function getMainList(type = '') {
  return post('/adventure/main_list', {
    type // main(主线)
  })
}

// 获取历练区列表
export function getFightZoneList() {
  return post('/adventure/fight_zone', {
  })
}

// 获取光明顶信息
export function getGuangmingPeakInfo() {
  return post('/adventure/guangming_peak_info', {
  })
}

// 挑战光明顶
export function challengeGuangmingPeak(floor) {
  return post('/adventure/guangming_peak_challenge', {
    floor
  })
}

// 光明顶战斗结算
export function settleGuangmingPeak(battleId, floor, isWin) {
  return post('/adventure/guangming_peak_settle', {
    battle_id: battleId,
    floor,
    is_win: isWin
  })
}

// 获取算命先生信息
export function getFortuneTellerInfo() {
  return post('/adventure/fortune_teller_info', {
  })
}

// 算命
export function fortuneTellerFortune() {
  return post('/adventure/fortune_teller_fortune', {
  })
}

// 重置算命（重新算命）
export function fortuneTellerReset() {
  return post('/adventure/fortune_teller_reset', {
  })
}

// 获取神兵谷信息
export function getWeaponValleyInfo() {
  return post('/adventure/weapon_valley_info', {
  })
}

// 挑战神兵谷敌人
export function challengeWeaponValley(enemyId) {
  return post('/adventure/weapon_valley_challenge', {
    enemy_id: enemyId
  })
}

// 神兵谷战斗结算
export function settleWeaponValley(battleId, enemyId, isWin) {
  return post('/adventure/weapon_valley_settle', {
    battle_id: battleId,
    enemy_id: enemyId,
    is_win: isWin
  })
}

export default {
  getAdventureInfo,
  getMainList,
  getFightZoneList,
  getGuangmingPeakInfo,
  challengeGuangmingPeak,
  settleGuangmingPeak,
  getFortuneTellerInfo,
  fortuneTellerFortune,
  fortuneTellerReset,
  getWeaponValleyInfo,
  challengeWeaponValley,
  settleWeaponValley,
}